package com.ruoyi.app.controller;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.system.service.ISysUserService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author hct
 * @date 2020/10/15
 */
@Api(value = "管家列表")
@RestController
@RequestMapping("/app/user")
@CrossOrigin
public class AppGuanjiaController {

    @Autowired
    private ISysUserService userService;


/**
     * 轮播图列表页面 只展示5张图
     */

    @GetMapping("/list")
    public AjaxResult list(SysUser user) {
      /* SysDept dept=new SysDept();
        dept.setDeptId(5L);
        user.setDept(dept);
      */  user.setDeptId(5L);
        // 获取用户列表
        List<SysUser> list = userService.selectUserListByFront(user);
        return AjaxResult.success(list);
    }

/*

*
     * 跳转到详细页面

*/

    @GetMapping("/detail/{id}")
    public AjaxResult toDetail(@PathVariable("id") Long id) {
         return AjaxResult.success(userService.selectUserById(id));
    }

}